home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / helicopter_effects_scripts / helicopter_shot_fly.lua < prev    next >
Encoding:
Text File  |  2006-02-27  |  2.4 KB  |  87 lines

  1.  
  2. function helicopter_shot_fly1()
  3.     local explosion = uniGetExecutor()
  4.     explosion:setTransformOwner()
  5.     local mshot1 = explosion:addSimpleEffect(ENET_EFFECT_PS_HELICOPTERSHOT_FLY)
  6.     local shotlight = explosion:addSimpleEffect(ENET_EFFECT_HELICOPTER_LIGHTSPOT)
  7. --    waitDeath(explosion:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,150,uniGetTarget()),1000)
  8.     waitDeath(explosion:forwardFly(uniGetTarget(),150))
  9.     mshot1:suspendedDestroy(4.0)
  10.     local exp_ps = explosion:addSimpleEffect(ENET_EFFECT_PS_HELICOPTERSHOT_EXPLOSION)
  11.     uniGetTarget():executeCommand(ENC_DAMAGED)
  12.     pause(1.0)
  13.     exp_ps:suspendedDestroy(1.5)
  14.     shotlight:suspendedDestroy(1.5)
  15.     pause(1.5)
  16.     explosion:destroy()
  17. end
  18.  
  19. registerCommand(ENSCRIPTSET_HELICOPTERSHOT,ENC_FIRE1,"helicopter_shot_fly1")
  20.  
  21. --
  22. -- dummy effect creation test
  23. --
  24. desc = getEffectDescriptionP(ENET_EFFECT_HELICOPTERSHOT_FLY)
  25. desc.ClassID = ENCLASS_DUMMY
  26. desc.EffectClassType = ENECT_GEOMETRY
  27.  
  28. desc.ScriptSet = ENSCRIPTSET_HELICOPTERSHOT
  29. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  30. local vzbzd1 = D3DXVECTOR3:new(0,0,0)
  31. desc.LocalPosition = vzbzd1
  32. vzbzd1:delete()
  33. desc.MoveType = ENMOVE_FLY
  34.  
  35. desc.ActivityType = ENACT_COMMANDSEMIACTIVE
  36. --
  37. -- end dummy effect creation test
  38. --
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. --
  46. -- lightsource creation test
  47. --
  48. desc = getEffectDescriptionP(ENET_EFFECT_HELICOPTER_LIGHTSPOT)
  49. desc.ClassID = ENCLASS_LIGHTSOURCE
  50. desc.EffectClassType = ENECT_LIGHTSOURCE
  51.  
  52. desc.ScriptSet = ENSCRIPTSET_UNKNOWN
  53. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  54. local vzbzd2 = D3DXVECTOR3:new(0,0,0)
  55. desc.LocalPosition = vzbzd2
  56. vzbzd2:delete()
  57. desc.ActivityType = ENACT_SEMIACTIVE
  58.  
  59. -- add interpolators
  60. --desc.clearInterpolators()
  61.  
  62. local interpolator = createInterpolator()
  63. interpolator:addKey(0.0,70.0)
  64. interpolator:addKey(10.0,70.0)
  65. interpolator:finalize(false)
  66. -- add interpolator on light range
  67. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_LIGHT_RANGE))
  68.  
  69. local interpolator = createInterpolator()
  70. interpolator:addKey(0.0,1.0)
  71. interpolator:addKey(2.0,1.0)
  72. interpolator:addKey(3.0,1.0)
  73. interpolator:finalize(false)
  74. -- add interpolator on R B colors
  75. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_R))
  76. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_B))
  77. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_G))
  78.  
  79.  
  80. --
  81. -- end lightsource creation description
  82. --
  83.  
  84.  
  85.  
  86.  
  87.